package io.web.usercenter.controller;

import io.web.usercenter.common.BaseResponse;
import io.web.usercenter.common.ResultUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * MockListController.
 * mock accept list paramter
 *
 * @date 2023-05-18
 */
@RestController
@RequestMapping("/mock")
@Slf4j
public class MockListController {

    /**
     * 传入json数组 [1,2,3]
     * @param ids
     * @param request
     * @return
     */
    @PostMapping("/delete1")
    public BaseResponse<Boolean> delete1(@RequestBody List<Long> ids, HttpServletRequest request) {
        log.info("delete1 = {}", ids);
        return ResultUtils.success(true);
    }

    /**
     * get参数  ids=1,2,3
     * @param ids
     * @param request
     * @return
     */
    @GetMapping("/delete2")
    public BaseResponse<Boolean> delete2(@RequestParam List<Long> ids, HttpServletRequest request) {
        log.info("delete2 = {}", ids);
        return ResultUtils.success(true);
    }

    /**
     *  get参数 ids=1,2,3
     * @param ids
     * @param request
     * @return
     */
    @PostMapping("/delete3")
    public BaseResponse<Boolean> delete3(@RequestParam List<Long> ids, HttpServletRequest request) {
        log.info("delete3 = {}", ids);
        return ResultUtils.success(true);
    }
}
